package demo.set;

public class Test implements Comparable<Test> {
int value;
int age;
String name;

public Test(int value,String name,int age) {
   this.value=value;
   this.name=name;
   this.age=age;
}




/* (non-Javadoc)
 * @see java.lang.Object#toString()
 */
@Override
public String toString() {
	return "Test [value=" + value + ", age=" + age + ", name=" + name + "]";
}




@Override
public int compareTo(Test o) {
	  
	if(this.value>o.value){
		return 1;
	}else if (this.value<o.value){
		return -1;
	}else {
		return 0; //equal
	}
}



}
